﻿using DnDLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DnDClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Packet p = new Packet(textBox1.Text, Packet.Type.Raw);
            textBox2.Text = p.ToString();
            textBox2.Text += "\r\n" + string.Join(",", p.RawData);           

            Packet p2 = new Packet(p.RawData);
            textBox2.Text += "\r\n" + p2.ToString();
            textBox2.Text += "\r\n" + string.Join(",", p2.RawData);

            List<byte> l = new List<byte>();
            l.AddRange(p.RawData);
            l.AddRange(p2.RawData);
            l.Add(65);

            textBox2.Text += "\r\n" + Packet.ParsePackets(l).Count;
        }
    }
}
